import { ApiProperty } from '@midwayjs/swagger';
import { Rule, RuleType } from '@midwayjs/validate';
import { Column, Entity, PrimaryColumn } from 'typeorm';
@Entity({
  name: 'Transport',
  synchronize: false,
})
export class Transport {
  @Rule(RuleType.string().allow(null).min(0).required())
  @ApiProperty({ example: 'TS151000002' })
  @PrimaryColumn({ type: 'varchar', length: 32 })
  transportId: string;
  @Rule(RuleType.string().required())
  @ApiProperty({ example: '金太阳贸易公司' })
  @Column()
  supplier: string;
  @Rule(RuleType.string().required())
  @ApiProperty({ example: '万天信息有限公司' })
  @Column()
  receiver: string;
  @Rule(RuleType.date().allow(null).required())
  @ApiProperty({ example: new Date('2023-05-01T12:00:00') })
  @Column()
  transportTime: Date;
}
export class TransportQueryCondition {
  @Rule(RuleType.string().allow(null).min(0).required())
  @ApiProperty({ example: '金太阳' })
  supplierLike: string;
  @Rule(RuleType.date().allow(null).required())
  @ApiProperty({ example: new Date('2023-04-01T12:00:00') })
  transportTimeStart: Date;
  @Rule(RuleType.date().allow(null).required())
  @ApiProperty({ example: null })
  transportTimeEnd: Date;
  @ApiProperty({ example: 1 })
  @Rule(RuleType.number().min(1).required())
  pageNum: number;
  @ApiProperty({ example: 3 })
  @Rule(RuleType.number().min(1).required())
  pageSize: number;
}
export class TransportDto4Modify {}
